import router from './router'
//@ts-ignore
  const whtieList = ["/login", "/404"];

router.beforeEach((to, from, next) => {
  if (sessionStorage.getItem("token")) {
    if (to.path === "/login") {
      next("/");
    } else {
      next();
    }
  } else {
    if (whtieList.includes(to.path)) {
      next();
    } else {
      next("/login");
    }
  }
});